package zkclient.dwj.cn;

import org.I0Itec.zkclient.ZkClient;
import org.I0Itec.zkclient.serialize.SerializableSerializer;
import org.apache.zookeeper.data.Stat;

/**
 * Created by Administrator on 2017/11/13 0013.
 */
public class GetData {
    public static void main(String[] args) {
        ZkClient zc = new ZkClient("192.168.110.134:2181", 10000, 10000, new SerializableSerializer());
        System.out.println("connect ok");

        Stat stat = new Stat();//需要获取状态信息的话，定义Stat，然后传到readData
        User u = zc.readData("/dwj", stat);

        System.out.println(u.getId() + "," + u.getName());
        System.out.println(stat);
    }
}
